package com.cjm.one.model.goods.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import com.cjm.one.model.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 
 * @TableName goods_regional_inventory
 */
@TableName(value ="goods_regional_inventory")
@Data
public class GoodsRegionalInventory extends BaseEntity {
    /**
     * 
     */
//    @TableId(type = IdType.AUTO)
//    private Long id;

    /**
     * 商品id
     */
    @TableField("goods_id")
    @Schema(description = "商品id")
    private Long goodsId;

    /**
     * 地区id
     */
    @Schema(description = "地区id")
    @TableField("region_id")
    private Integer regionId;

    /**
     * 在该地区的库存
     */
    @Schema(description = "在该地区的库存")
    @TableField("stock_num")
    private Integer stockNum;

    /**
     * 该商品是否在该地区在售 0禁售 1在售
     */
    @Schema(description = "该商品是否在该地区在售 0禁售 1在售")
    @TableField("is_salable")
    private Integer isSalable;

    /**
     * 
     */
//    private Date createTime;
//
//    /**
//     *
//     */
//    private Date updateTime;
//
//    /**
//     * 删除标记（0:不可用 1:可用）
//     */
//    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsRegionalInventory other = (GoodsRegionalInventory) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getRegionId() == null ? other.getRegionId() == null : this.getRegionId().equals(other.getRegionId()))
            && (this.getStockNum() == null ? other.getStockNum() == null : this.getStockNum().equals(other.getStockNum()))
            && (this.getIsSalable() == null ? other.getIsSalable() == null : this.getIsSalable().equals(other.getIsSalable()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getRegionId() == null) ? 0 : getRegionId().hashCode());
        result = prime * result + ((getStockNum() == null) ? 0 : getStockNum().hashCode());
        result = prime * result + ((getIsSalable() == null) ? 0 : getIsSalable().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(this.getId());
        sb.append(", goodsId=").append(goodsId);
        sb.append(", regionId=").append(regionId);
        sb.append(", stockNum=").append(stockNum);
        sb.append(", isSalable=").append(isSalable);
        sb.append(", createTime=").append(this.getCreateTime());
        sb.append(", updateTime=").append(this.getUpdateTime());
        sb.append(", isDeleted=").append(this.getIsDeleted());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}